<?php

namespace App\Containers\AppSection\Questionnaire\UI\API\Transformers;

use App\Containers\AppSection\Questionnaire\Models\Field;
use App\Ship\Parents\Transformers\Transformer;

class FieldTransformer extends Transformer
{
    protected array $defaultIncludes = [

    ];

    /**
     * @var  array
     */
    protected array $availableIncludes = [

    ];

    public function transform(Field $t): array
    {
        return [
            'object' => $t->getResourceKey(),
            'include' => $this->getAvailableIncludes(),
            'id' => $t->getHashedKey(),
            'key' => $t->key,
            'type_key' => $t->type_key,
            'label' => $t->label,
            'placeholder' => $t->placeholder,
            'options' => $t->options,
            'default' => $t->default,
            'order' => $t->order,
            'depends_key' => $t->depends_key,
            'depends_value' => $t->depends_value,
            'required' => $t->required,

        ];
    }
}
